<#import "/admin/common/tree.html" as tree>
<#escape x as (x)!"">
<div class="page-dialog-content">
    <div class="panel-dialog">
		<form id="infoSaveForm" action="save" method="post" class="form-horizontal form-dialog-horizontal">
			<input type="hidden" name="id" value="${info.id}"/>
			<div class="panel-dialog-body">
				<#if parentInfo??>
				<div class="form-group">
					<label class="col-sm-3 control-label">上级部门：</label>
                    <div class="col-sm-6 control-value">
                    	${parentInfo.name}
                    </div>
                </div>
				</#if>
				<#if !parent??>
				<div class="form-group">
					<label class="col-sm-3 control-label"><span class="required" aria-required="true">*</span>上级部门：</label>
                    <div class="col-sm-6">
                    	<@tree.treeSelect treeUrl="selectTree">
                    	<input type="hidden" class="tree-id" name="parent" value=""/>
                   		<input type="text" class="tree-name tree-operate form-control required" readonly="readonly" placeholder="请选择上级部门"/>
                    	</@tree.treeSelect>
                    </div>
	            </div>
                <#else>
                   <input type="hidden" name="parent" value="${parent}"/>
				</#if>
				<div class="form-group">
                    <label class="col-sm-3 control-label"><span class="required" aria-required="true">*</span>部门名称：</label>
                    <div class="col-sm-6">
                    	<input type="text" name="name" value="${info.name}" class="form-control required" maxlength="20" placeholder="请输入部门名称"/>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label"><span class="required" aria-required="true">*</span>排序：</label>
                    <div class="col-sm-6">
                    	<input type="text" name="sort" value="${info.sort!0}" class="form-control required digits" maxlength="20" placeholder="请输入排序值"/>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label">备注：</label>
                    <div class="col-sm-6">
						<textarea id="remarks" name="remarks" rows="3" cols="" maxlength="100" class="form-control " placeholder="请输入备注信息">${info.remarks}</textarea>
                    </div>
                </div>
			</div>
			
			<div class="panel-footer panel-dialog-footer">
				<div class="text-right">
					<button id="dialog-btn-save" type="submit" class="btn btn-primary">保存</button>
					<button type="button" onclick="layer.closeAll();" class="btn btn-default">取消</button>
				</div>
			</div>
		</form>
	</div>
</div>
<script type="text/javascript">
// newData = ${treeList};
// $(function () {
// 	$.fn.zTree.init($("#deptList"), settingGroup, newData);
// });
$(function(){
	frm.submit("dialog", "infoSaveForm");
});
</script>
</#escape>
